<?php
include 'Model.class.php';
if($_POST['method']==="add_forum"){
    $column_name=$_POST['column_name'];
    $column_intr=$_POST['column_intr'];
    $H=new Model();
    echo $H->add_forum($column_name,$column_intr);
}

if($_POST['method']==="list_forum"){
    $H=new Model();
    echo $H->list_forum();
}

if($_POST['method']==="list_thread"){
    $m_id=$_POST['m_id'];
    $H=new Model();
    echo $H->list_thread($m_id);
}

if($_POST['method']==="add_thread"){
    $m_id=$_POST['m_id'];
    $context=$_POST['context'];
    $title=$_POST['title'];
    $name=!$_POST['name']?"guest":$_POST['name'];
    $H=new Model();
    echo $H->add_thread($title,$context,$name,$m_id);
}

